//
//  SelectionTableCell.m
//
//
//  Created by gynjobs on 2017/8/14.
//  Copyright © 2017年 gynjobs. All rights reserved.
//

#import "SelectionTableCell.h"

@implementation SelectionTableCell
-(instancetype)init{
    
    if(self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:SELECTION_CELL_ID]){
        
        self.contentTextFiled = [[UITextField alloc] init];
        self.contentTextFiled.userInteractionEnabled = NO;
        self.contentTextFiled.textAlignment = NSTextAlignmentRight;
        self.contentTextFiled.font = [UIFont systemFontOfSize:UI_FOND_HOME_CREDIT_CELL_MAIN_1];
        
        self.indicatorView = [[UIImageView alloc] init];
        self.indicatorView.image = [UIImage imageNamed:UI_IMAGE_ARROW_RIGHT];
        
        [self addSubview:self.contentTextFiled];
        [self addSubview:self.indicatorView];
        
    }
    
    [self updateConstraintsIfNeeded];
    return self;
    
}


-(void)updateConstraints{
    
    [super updateConstraints];
    
    
    [self.indicatorView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.equalTo(self.mas_right).with.offset(-LEFT_RIGHT_SPACE);
        make.centerY.equalTo(self.mas_centerY);
        make.width.mas_equalTo(INDICATOR_VIEW_WIDTH);
        make.height.mas_equalTo(INDICATOR_VIEW_HEIGHT);
        
    }];
    
    [self.contentTextFiled mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.equalTo(self.indicatorView.mas_left).with.offset(-LEFT_RIGHT_SPACE);
        make.centerY.equalTo(self.mas_centerY);
        
    }];
    
}


@end
